layui.define(['element', 'listener'], function(exports) {
	"use strict";

	/**
	 * Button component
	 * */
	var MOD_NAME = 'enav',
		$ = layui.jquery,
		listener = layui.listener;

	var enav = function(opt) {
		this.option = opt;
	};


    /**
	 * Button start loading
	 * */
	 enav.prototype.render = function(opt) {
		
		var option = {
			elem: opt.elem,
            data: opt.data
		}
        var html = '<span class="layui-breadcrumb">'
        if(option.data && option.data.length>0){
            option.data.forEach(function(item,index){
                html += '<a href="#">'+item.title+'</a>'
                if(option.data.length-1 !== index){
                    html += '<i class="layui-icon layui-icon-right" style="font-size: 12px; color: #666;"></i> '
                }
            })
            
        }
        html += '</span>'
        $(option.elem).html(html)

        return new enav(option);
	}



    exports(MOD_NAME, new enav());
});
